package com.example.controller;

import com.example.api.AddService;
import com.example.api.SubService;
import com.example.spring.annotation.RpcReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

    @RpcReference
    private AddService addService;

    @RpcReference
    private SubService subService;

    @GetMapping("/add")
    public Integer add(@RequestParam("a") Integer a, @RequestParam("b") Integer b) {
        return addService.add(a, b);
    }

    @GetMapping("/sub")
    public Integer sub(@RequestParam("a") Integer a, @RequestParam("b") Integer b) {
        return subService.sub(a, b);
    }



}
